package visiopuce.graph;

import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;

public class GraphPopupMenu extends JPopupMenu {


	private JMenuItem zoomInDomainMenuItem;
	private JMenuItem zoomOutDomainMenuItem;
	private JMenuItem zoomResetDomainMenuItem;

	public GraphPopupMenu(MyChartPanel cp) {

	super();

		JMenuItem copyItem = new JMenuItem("Copier");
		copyItem.setActionCommand(cp.COPY_COMMAND);
		copyItem.addActionListener(cp);
		add(copyItem);



		JMenuItem saveItem = new JMenuItem("Enregistrer sous..");
		saveItem.setActionCommand(cp.SAVE_COMMAND);
		saveItem.addActionListener(cp);
		add(saveItem);

		JMenuItem printItem = new JMenuItem("Imprimer...");
		printItem.setActionCommand(cp.PRINT_COMMAND);
		printItem.addActionListener(cp);
		add(printItem);
		addSeparator();

		this.zoomInDomainMenuItem = new JMenuItem("Zoom avant");
		this.zoomInDomainMenuItem.setActionCommand(cp.ZOOM_IN_DOMAIN_COMMAND);
		this.zoomInDomainMenuItem.addActionListener(cp);

		add(zoomInDomainMenuItem);

		this.zoomOutDomainMenuItem = new JMenuItem("Zoom arrière");
		this.zoomOutDomainMenuItem.setActionCommand(cp.ZOOM_OUT_DOMAIN_COMMAND);
		this.zoomOutDomainMenuItem.addActionListener(cp);
		
		add(zoomOutDomainMenuItem);

		this.zoomResetDomainMenuItem = new JMenuItem("Zoom automatique");
		this.zoomResetDomainMenuItem.setActionCommand(cp.ZOOM_RESET_DOMAIN_COMMAND);
		this.zoomResetDomainMenuItem.addActionListener(cp);
		
		addSeparator();
		add(zoomResetDomainMenuItem);


	}
}
